{extend name="common/public" /}
{block name="content"}

<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
    <div class="widget am-cf">
        <div class="widget-head am-cf">
            <div class="widget-title am-fl">用户信息</div>
            <div class="widget-function am-fr">
                <a href="javascript:;" class="am-icon-cog"></a>
            </div>
        </div>
        <div class="widget-body  widget-body-lg am-fr">
            <form action="{:url()}">
                <select name="user_class" data-am-selected="{searchBox: 2}">
                    <option value="0" {eq name="$Request.param.user_class" value="0" }selected{/eq}>全部</option>
                    <option value="1" {eq name="$Request.param.user_class" value="1" }selected{/eq}>普通用户</option>
                    <option value="2" {eq name="$Request.param.user_class" value="2" }selected{/eq}>回收员</option>
                </select>
                <input name="keywords" value="{$Request.param.keywords}" placeholder="昵称搜索">
                <button type="submit" class="am-btn am-btn-xs am-btn-default am-btn-success"><span
                        class="am-icon-search"></span> 确定
                </button>
            </form>
            <table width="100%" class="am-table am-table-compact am-table-bordered tpl-table-black ">
                <thead>

                <tr>

                    <th class="am-lg-text-center">
                        头像
                    </th>
                    <th class="am-lg-text-center">
                        昵称
                    </th>
                    <th class="am-lg-text-center">
                        会员类型
                    </th>
                    <th class="am-lg-text-center">
                        总评价数
                    </th>
                    <th class="am-lg-text-center">
                        评分
                    </th>
                    <th class="am-lg-text-center">
                        注册时间
                    </th>
                    <th class="am-lg-text-center">
                        最后登录时间
                    </th>
                    <th class="am-lg-text-center">
                        状态
                    </th>
                    <th class="am-lg-text-center">
                        积分
                    </th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

                {foreach $list as $v}

                <tr class="gradeX">

                    <td class='am-lg-text-center'><img src="{$v.headimgurl}" style="width: 50px;height: 50px;"></td>
                    <td class='am-lg-text-center'> {$v.nickname}</td>

                    <td class='am-lg-text-center'> {eq name='$v.user_class' value='1'}普通用户{else/}回收员{/eq}</td>
                    <td class='am-lg-text-center'>
                        {eq name='$v.user_class' value='2'}
                            {$v.total_appraise|default='0'}
                        {/eq}
                    </td>
                    <td class='am-lg-text-center' style="font-size: 12px;color: orange;">
                        {eq name='$v.user_class' value='2'}
                            <div>接单：{$v.receiving|default='5.0'}分</div>
                            <div>上门：{$v.come|default='5.0'}分</div>
                            <div>服务：{$v.service|default='5.0'}分</div>
                            <div>综合分：{$v.total|default='15.0'}分</div>
                        {/eq}
                    </td>

                    <td class='am-lg-text-center'> {$v.create_time}</td>
                    <td class='am-lg-text-center'> {$v.location_time?$v.location_time:$v.login_time}</td>

                    <td class="am-lg-text-center">



                        <div id="status_{$v.id}">
                            {eq name='$v.is_lock' value='0'}正常登录{else/}拉黑{/eq}
                        </div>
                        <div class="tpl-switch" style="text-align: center;margin: 0 auto;">
                            <input type="checkbox" onchange="setShow(this,'{$v.openid}','{$v.id}')"  class="ios-switch bigswitch tpl-switch-btn am-margin-top-xs" {eq name='$v.is_lock' value="0"}checked{/eq}>
                            <div class="tpl-switch-btn-view" style="text-align: center;margin: 0 auto;">
                                <div></div>
                            </div>
                        </div>

                    </td>

                    <td class='am-lg-text-center'> {$v.integral}</td>

                    <td>

                        <div class="tpl-table-black-operation">

                            {eq name='$v.user_class' value='2'}
                                <a onclick="openUrl('{:url('userOrderList',['user_id'=>$v['id']])}')">
                                    <i class="am-icon-eye"></i> 上门明细
                                </a>
                            {/eq}
                            <a href="{:url('share',['user_id'=>$v['id']])}">
                                <i class="am-icon-eye"></i> 推广查询
                            </a>
                            <div class="tpl-table-black-operation">
                                <a onclick="openUrl('{:url('userOrderList',['share_id'=>$v['id']])}')">
                                    <i class="am-icon-eye"></i> 卖出明细
                                </a>
                            </div>

                        <!--    <a onclick="openUrl('{:url('edit',['id'=>$v['id']])}')">
                                <i class="am-icon-pencil"></i> 编辑
                            </a>-->
                            <!--   <a href="javascript:;" class="tpl-table-black-operation-del">
                                   <i class="am-icon-trash"></i> 删除
                               </a>-->
                        </div>

                    </td>

                </tr>

                {/foreach}


                </tbody>
            </table>

            {$list|raw}

        </div>
    </div>
</div>

{/block}
{block name='script'}
<script type="text/javascript">

    function setShow(dom,id,user_id) {
        $('#status_'+user_id).text(dom.checked?'正常登录':'拉黑');
        $.get("{:url('lock')}",{'openid':id,'is_lock':dom.checked?0:1})
    }
</script>
{/block}
{/extend}
